package com.one.blocks.security.authc.password;

import org.springframework.security.authentication.AbstractAuthenticationToken;

/**
 * @author <a href="mailto:idler41@163.con">linfuxin</a> created on 2023-08-26 16:06:14
 */
public class PasswordAuthenticationToken extends AbstractAuthenticationToken {

    private final String username;
    private final String rawPassword;

    public PasswordAuthenticationToken(String username, String rawPassword) {
        super(null);
        this.username = username;
        this.rawPassword = rawPassword;
    }

    @Override
    public Object getCredentials() {
        return rawPassword;
    }

    @Override
    public Object getPrincipal() {
        return username;
    }
}
